package com.qijian.business.domain.query;

import com.qijian.common.utils.mybatis.WhereType;
import com.qijian.common.utils.mybatis.WhereTypeEnum;
import lombok.Data;
import lombok.ToString;
import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigDecimal;
import java.util.List;
import java.util.Set;


/**
 * 供应商对象 查询条件类
 *
 * @author qijian
 * @date 2021-09-06
 */

@Data
@ToString
@TableName("purm_supplier")
public class SupplierQuery {
    @WhereType(tableName = "purm_supplier", filed = "id")
    private Long id;
    @WhereType(tableName = "purm_supplier", filed = "name", type = WhereTypeEnum.LIKE)
    private String name;
    @WhereType(tableName = "purm_supplier", filed = "number", type = WhereTypeEnum.LIKE)
    private String number;
    @WhereType(tableName = "purm_supplier", filed = "classify_id", type = WhereTypeEnum.IN)
    private Set<Long> classifyIds;
    @WhereType(tableName = "purm_supplier", filed = "classify_name", type = WhereTypeEnum.LIKE)
    private String classifyName;
    @WhereType(tableName = "purm_supplier", filed = "province", type = WhereTypeEnum.LIKE)
    private String province;
    @WhereType(tableName = "purm_supplier", filed = "province", type = WhereTypeEnum.LIKE)
    private String city;
    @WhereType(tableName = "purm_supplier", filed = "supplier_contact_id")
    private Long supplierContactId;
    @WhereType(tableName = "purm_supplier_contact", filed = "name", type = WhereTypeEnum.LIKE)
    private String supplierContactName;
    @WhereType(tableName = "purm_supplier_contact", filed = "office_phone", type = WhereTypeEnum.LIKE)
    private String supplierContactOfficePhone;
    @WhereType(tableName = "purm_supplier_contact", filed = "telephone", type = WhereTypeEnum.LIKE)
    private String supplierContactTelephone;
    @WhereType(tableName = "purm_supplier", filed = "trade")
    private Integer trade;
    @WhereType(tableName = "purm_supplier", filed = "level")
    private Integer level;
    @WhereType(tableName = "purm_supplier", filed = "processing_procedure")
    private Integer processingProcedure;
    @WhereType(tableName = "purm_supplier", filed = "supplier_type")
    private Integer supplierType;
    @WhereType(tableName = "purm_supplier", filed = "postcode")
    private String postcode;
    @WhereType(tableName = "purm_supplier", filed = "company_address")
    private String companyAddress;
    @WhereType(tableName = "purm_supplier", filed = "legal_person")
    private String legalPerson;
    @WhereType(tableName = "purm_supplier", filed = "scale")
    private Long scale;
    @WhereType(tableName = "purm_supplier", filed = "registered_capital")
    private BigDecimal registeredCapital;
    @WhereType(tableName = "purm_supplier", filed = "company_intro")
    private String companyIntro;
    @WhereType(tableName = "purm_supplier", filed = "bank")
    private String bank;
    @WhereType(tableName = "purm_supplier", filed = "bank_account")
    private String bankAccount;
    @WhereType(tableName = "purm_supplier", filed = "bank_account_name")
    private String bankAccountName;
    @WhereType(tableName = "purm_supplier", filed = "duty_paragraph")
    private String dutyParagraph;
    @WhereType(tableName = "purm_supplier", filed = "invoice_address")
    private String invoiceAddress;
    @WhereType(tableName = "purm_supplier", filed = "invoice_phone")
    private String invoicePhone;
    @WhereType(tableName = "purm_supplier", filed = "payment_days")
    private Long paymentDays;
    @WhereType(tableName = "purm_supplier", filed = "settlement_day")
    private Integer settlementDay;
    @WhereType(tableName = "purm_supplier", filed = "id")
    private Long supplierId;
    @WhereType(filed = "id", type = WhereTypeEnum.IN)
    private Set<Long> ids;
    @WhereType(deptTableName = "sys_user", userTableName = "sys_user")
    private Boolean dataScope;
    @WhereType(ignore= true)
    private List<String> approvalStatus;
    @WhereType(func = "EXISTS (select 1 from t_flowable_record f  where purm_supplier.id = f.source_id and f.business_key= 'purm_supplier_retrial' and f.user_id ={1})")
    private Long u;
    @WhereType(func = "EXISTS (select 1 from t_flowable_record f left join ACT_RU_TASK ru on ru.PROC_INST_ID_=f.process_instance_id inner join ACT_HI_IDENTITYLINK i on i.TASK_ID_=ru.ID_  where purm_supplier.id = f.source_id and f.business_key= 'purm_supplier_retrial'  and ( ru.ASSIGNEE_ ={1} or i.USER_ID_ = {1} ))")
    private Long i;
    @WhereType(filed = "approval_review_status" ,type = WhereTypeEnum.IN)
    private List<String> approve;
}
